package com.kk.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kk.dao.UserDao;
import com.kk.po.User;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * the class of spring_security_demo
 *
 * <p>
 * .
 *
 * @author little_lunatic
 * @date 2023-06-14
 */
@Service
@RequiredArgsConstructor
public class UserInfoService extends ServiceImpl<UserDao, User> {

    private final UserDao userDao;

    public User getUserInfoByUsername(String username) {
        QueryWrapper<User> userQueryWrapper = new QueryWrapper<>();
        userQueryWrapper.eq("username", username);
        User user = userDao.selectOne(userQueryWrapper);


        return user;
    }
}
